using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HtmlAgilityPack;
public partial class _Default : System.Web.UI.Page 
{
     String testForm(String url)
        {
            String result = "";
            
            HtmlWeb hw = new HtmlWeb();
            // get the document from the Internet resource
            HtmlDocument doc = hw.Load(url);
            HtmlNodeCollection forms = doc.DocumentNode.SelectNodes("//form");

            if (forms == null)
            {
                result = "No forms founded!";
            }
            else
            {
                foreach (HtmlNode form in forms)
                {
                    result += "FORM: id=" + form.GetAttributeValue("id", "") +  "action=" + form.GetAttributeValue("action", "") + "<br/>";
                    // each form
                    HtmlNodeCollection inputs = form.SelectNodes("//input");
                    if (null == inputs)
                        result += "";
                    else
                    {
                        int i = 0;
                        foreach (HtmlNode input in inputs)
                        {
                            result += "No: " + (i++) + "param: " + input.GetAttributeValue("name", "") + "<br/>";
                        }
                    }
                }
            }
            return result; 

        }
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack)
        {
            output.Text = testForm(urlinput.Text);
        }
    }
    protected void go_Click(object sender, EventArgs e)
    {
    }
}